package com.jiangxjsy.core.common;

import com.jiangxjsy.core.constant.LoginTypeConstant;
import lombok.Getter;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/4 21:52
 */

@Getter
public enum LoginType {
    PASSWORD_LOGIN(LoginTypeConstant.PASSWORD_LOGIN),
    VERIFICATION_CODE_LOGIN(LoginTypeConstant.VERIFICATION_CODE_LOGIN),
    ENTERPRISE_WECHAT_LOGIN(LoginTypeConstant.ENTERPRISE_WECHAT_LOGIN),
    ENTERPRISE_WECHAT_SCAN_QR_LOGIN(LoginTypeConstant.ENTERPRISE_WECHAT_SCAN_QR_LOGIN);

    private final Integer type;

    LoginType(Integer type) {
        this.type = type;
    }

    public static LoginType valueOf(Integer type) {
        for (LoginType value : values()) {
            if (value.type.equals(type)){
                return value;
            }
        }
        return PASSWORD_LOGIN;
    }
}
